<% layout('/layouts/default.html', {title: '住户信息管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('住户信息管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('ab:abHouse:edit')){ %>
					<a href="${ctx}/ab/abHouse/form" class="btn btn-default btnTool" title="${text('新增住户信息')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${abHouse}" action="${ctx}/ab/abHouse/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('floor_code')}：</label>
					<div class="control-inline">
						<#form:input path="floorCode" maxlength="64" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('用户名')}：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="45" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('地址')}：</label>
					<div class="control-inline">
						<#form:input path="addr" maxlength="200" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("楼宇名称")}', name:'floorName', index:'a.floor_name', width:150, align:"left"},
		{header:'${text("用户名")}', name:'name', index:'a.name', width:150, align:"left"},
		{header:'${text("面积")}', name:'area', index:'a.area', width:150, align:"left"},
		{header:'${text("测温id")}', name:'equipNo', index:'a.equip_no', width:150, align:"left"},
		{header:'${text("地址")}', name:'addr', index:'a.addr', width:150, align:"left"},
		{header:'${text("注册时间")}', name:'regDate', index:'a.reg_date', width:150, align:"center"},
		{header:'${text("测温型号")}', name:'equipType', index:'a.equip_type', width:150, align:"left"},
		{header:'${text("典型用户")}', name:'typical', index:'a.typical', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_yes_no')}, val, '${text("否")}', true);
		}},
		{header:'${text("阀型号")}', name:'faType', index:'a.fa_type', width:150, align:"left"},

		{header:'${text("阀ID")}', name:'faId', index:'a.fa_id', width:150, align:"left"},
		{header:'${text("阀锁")}', name:'faOpen', index:'a.fa_open', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_yes_no')}, val, '${text("否")}', true);
		}},
		{header:'${text("备注")}', name:'remarks', index:'a.remarks', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, sortable:false, title:false, formatter: function(val, obj, row, act){
			var actions = [];
			<% if(hasPermi('ab:abHouse:edit')){ %>
				actions.push('<a href="${ctx}/ab/abHouse/form?houseCode='+row.houseCode+'" class="btnList" title="${text("编辑住户信息")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/ab/abHouse/delete?houseCode='+row.houseCode+'" class="btnList" title="${text("删除住户信息")}" data-confirm="${text("确认要删除该住户信息吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>